package wangm.controller;

import org.aspectj.lang.annotation.*;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

/**
 * description
 *
 * @author zk
 * @since 2018/7/7
 */
@Aspect
@Component
public class AopTest2 implements Ordered {
    @Pointcut(value = "@annotation(org.springframework.web.bind.annotation.RequestMapping)")
    public void pointCut2(){
        System.out.println("point cut is or not use");
    }

    @Before(value = "pointCut2()")
    public void before2(){
        System.out.println("before 2");
    }

    @After(value = "pointCut2()")
    public void after2(){
        System.out.println("after 2");
    }

    @AfterReturning("pointCut2()")
    public void returnObject2(){
        System.out.println("return 2");
    }

    @Override
    public int getOrder() {
        return 2;
    }
}
